#编译libVDModule.so
#makefile version2.0
CC=g++
RM=rm -f
#头文件路径
INCLUDE=-I/home/stt/Desktop/ffmpeg-4.2.2/build/include
#动态库路径
LIBDIR=-L/home/stt/Desktop/ffmpeg-4.2.2/build/lib -lavcodec -lavdevice -lavfilter -lavformat -lavutil -lpostproc -lswresample -lswscale -lSDL2
CPPVER=--std=c++11
#所有输出
ALLOBJ=SCModuleManager.o IStreamCapture.o Resampler.o AudioPlaySession.o  AudioPlay.o Decoder.o Demux.o FrameQueue.o PacketQueue.o Session.o StreamCapture.o Tools.o Dump.o
#-g -Debug
CFLAGS+=$(INCLUDE) $(LIBDIR) $(CPPVER) -fPIC
DESDIR=/home/stt/Desktop/ffmpeg-4.2.2/build/lib/

libStreamCapture.so:$(ALLOBJ)
	$(CC) $^ $(CFLAGS) -shared -o $@

%.o:%.cpp
	$(CC) -c $^ $(CFLAGS) -o $@
	
Resampler.o:./AudioPlay/Resampler.cpp
	$(CC) -c $^ $(CFLAGS) -o $@
	
AudioPlaySession.o:./AudioPlay/AudioPlaySession.cpp
	$(CC) -c $^ $(CFLAGS) -o $@

AudioPlay.o:./AudioPlay/AudioPlay.cpp
	$(CC) -c $^ $(CFLAGS) -o $@
	
Decoder.o:./StreamCapture/Decoder.cpp
	$(CC) -c $^ $(CFLAGS) -o $@
	
Demux.o:./StreamCapture/Demux.cpp
	$(CC) -c $^ $(CFLAGS) -o $@
	
FrameQueue.o:./StreamCapture/FrameQueue.cpp
	$(CC) -c $^ $(CFLAGS) -o $@
	
PacketQueue.o:./StreamCapture/PacketQueue.cpp
	$(CC) -c $^ $(CFLAGS) -o $@
		
Session.o:./StreamCapture/Session.cpp
	$(CC) -c $^ $(CFLAGS) -o $@
	
StreamCapture.o:./StreamCapture/StreamCapture.cpp
	$(CC) -c $^ $(CFLAGS) -o $@
	
Tools.o:./StreamCapture/Tools.cpp
	$(CC) -c $^ $(CFLAGS) -o $@

Dump.o:./StreamCapture/Dump.cpp
	$(CC) -c $^ $(CFLAGS) -o $@
	
clean:
	$(RM) r *.o libStreamCapture.so
	
cp:
	cp libStreamCapture.so $(DESDIR)libStreamCapture.so
cleanall:
	$(RM) r *.o libStreamCapture.so $(DESDIR)libStreamCapture.so
